package com.qk.management.service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qk.common.PageResult;
import com.qk.entity.OperateLog;
import com.qk.management.mapper.OperateLogMapper;
import com.qk.management.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 16778
 * @date 2025/10/15 20:41
 * @description
 */
@Service
public class LogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog> implements LogService {
    @Autowired
    private OperateLogMapper operateLogMapper;
    @Override
    public PageResult<OperateLog> pages(String operateUserName, Integer page, Integer pageSize) {
        Page pageParam = new Page(page,pageSize);
        Page<OperateLog> pages = operateLogMapper.pages(pageParam,operateUserName);
        return PageResult.<OperateLog>builder()
                .total(pages.getTotal())
                .rows(pages.getRecords())
                .build();
    }
}
